﻿<?php
$op=sscls_Request::getRequest('o');
?>
<div class="dac-tinh">
            <table cellspacing="0" cellpadding="0" border="0" width="100%" id="thuoc-tinh-san-pham">
                <tbody>
                    <tr>
                        <td width="8" valign="top" style="background-color: rgb(0, 0, 0);">
                        </td>
						<td align="left" width="97" valign="top" class="<?php echo ($op=='thong-tin-chung'||$op=='')?'listsp_d':'listsp' ?>">
                            <a href="index.php?c=product&t=details&productid=<?php echo sscls_Request::getRequest('productid') ?>&o=thong-tin-chung#divData">Thông tin chung</a>
                        </td>
                        <td align="left" width="97" valign="top" class="<?php echo ($op=='thuoc-tinh')?'listsp_d':'listsp' ?>">
                            <a href="index.php?c=product&t=details&productid=<?php echo sscls_Request::getRequest('productid') ?>&o=thuoc-tinh#divData">Thuộc tính KT </a>
                        </td>
                        <td align="left" width="97" valign="top" class="<?php echo ($op=='gallery')?'listsp_d':'listsp' ?>">
                            <a href="index.php?c=product&t=details&productid=<?php echo sscls_Request::getRequest('productid') ?>&o=gallery#divData">Gallery</a>
                        </td>
                        <td align="left" width="97" valign="top" class="<?php echo ($op=='so-sanh')?'listsp_d':'listsp' ?>">
                            <a href="index.php?c=product&t=details&productid=<?php echo sscls_Request::getRequest('productid') ?>&o=so-sanh#divData">
                                So sánh</a>
                        </td>
                        <td align="left" width="97" valign="top" class="<?php echo ($op=='bang-gia')?'listsp_d':'listsp' ?>">
                            <a href="index.php?c=product&t=details&productid=<?php echo sscls_Request::getRequest('productid') ?>&o=bang-gia#divData">
                                Bảng giá</a>
                        </td>
                        <td align="left" width="205" valign="top" style="background-color: rgb(0, 0, 0);">
                        </td>
                    </tr>
                </tbody>
            </table>
            <div id="divData">
			<?php
			
			if($op=='thuoc-tinh'){
			?>
			<div id="pnlThongSo">
				<table cellspacing="0" cellpadding="0" border="0" width="100%">
				<tbody>
					<tr>
						<td colspan="4">
							&nbsp;
						</td>
					</tr>
					<?php if(is_array(@$this->attri)){ ?>
						<?php foreach($this->attri as $attri){ ?>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="50%" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<?php echo $attri->name ?>
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<?php echo @$this->model->getAttriValue(@$attri->id,@$this->item->id) ?></td><td width="15px">
							&nbsp;
						</td>
					</tr>
						<?php } ?>
					<?php } ?>
				
			
				</tbody>
			</table>

			</div>
	<?php } 
		if($op=='so-sanh'){
		?>
			<div id="pnlThongSo">
				<table cellspacing="0" cellpadding="0" border="0" width="100%">
				<tbody>
				<tr>	
					<td colspan="4">
						<table width="100%" align="center" border="0">
							<tbody><tr><td width="50%" align="center">
								<img title="<?php echo $this->item->productname ?>" alt="<?php echo $this->item->productname ?>" src="admin/images/products/<?php echo $this->productImage1[0]->image_name ?>" width="128" height="85">
								</td>
								<td align="center">
									<img title="<?php echo $this->item2->productname ?>" alt="<?php echo $this->item2->productname ?>" src="admin/images/products/<?php echo $this->productImage2[0]->image_name ?>" width="128" height="85">
								</td>
							</tr>
							<tr>
								<td align="center"><span><?php echo $this->item->productname ?></span></td>
								<td align="center"><span><?php echo $this->item2->productname ?></span></td>
							</tr>
						</tbody></table>
					</td>
				</tr>
				<tr>
                    <td align="center" colspan="4">
                       <form id="f1" method="post" name="sosanh">	
                        <select onchange="document.sosanh.submit();"  name="product_id_orther">
							<option value="0"> ---Chọn xe--- </option>
							<?php foreach((array)$this->products as $product){ ?>
							<option <?php echo ($this->item2->id==$product->id)?'selected':''; ?> value="<?php echo  $product->id ?>"><?php echo $product->name ?> -- <?php echo $product->productname ?></option>
							<?php } ?>
						</select>                                  
						</form>
                            </td>
                    </tr>
					<tr>
						<td colspan="4">
							&nbsp;
						</td>
					</tr>
					<tr style="background-color: rgb(153, 153, 153);">
						<td width="15px">
							&nbsp;
						</td>
						<td height="22px" width="190px">
							<span style="color: rgb(255, 255, 255); font-weight: bold; padding-left: 5px;">Thuộc tính</span></td>
						<td><span style="color: rgb(0, 0, 0); font-weight: bold;"><?php echo $this->item->productname ?></span></td>
						<td>
						<span style="color: rgb(0, 0, 0); font-weight: bold;"><?php echo $this->item2->productname ?></span></td>
					</tr>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="20%" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							Giá
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							<h3 style="color:red;"><?php echo $this->item->price.' VND' ?></h3></td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<h3 style="color:red;"><?php echo $this->item2->price.' VND' ?></h3></td><td width="15px">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="20%" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							Loại xe
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							<h3 style="color:blue;"><?php echo $this->item->catname ?></h3></td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<h3 style="color:blue;"><?php echo $this->item2->catname ?></h3></td><td width="15px">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="20%" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							Model
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							<?php echo $this->item->modename ?></td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<?php echo $this->item2->modename ?></td><td width="15px">
							&nbsp;
						</td>
					</tr>
					<?php if(is_array(@$this->attri)){ ?>
						<?php foreach($this->attri as $ki=>$attri){ ?>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="20%" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							<?php echo $attri->name ?>
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);border-right: 1px solid rgb(153, 153, 153);">
							<?php echo @$this->model->getAttriValue(@$attri->id,@$this->item->id) ?></td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<?php echo @$this->model->getAttriValue(@$this->attri2[$ki]->id,@$this->item2->id) ?></td><td width="15px">
							&nbsp;
						</td>
					</tr>
						<?php } ?>
					<?php } ?>
				
			
				</tbody>
			</table>

			</div>
	<?php }
	if($op=='thong-tin-chung'){
			?>
			<div id="pnlThongSo">
				<table cellspacing="0" cellpadding="0" border="0" width="100%">
				<tbody>
					<tr>
						<td colspan="4">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="50%" style="border-bottom: 1px solid rgb(153, 153, 153);">
							Tên sản phẩm
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);color:blue;font-wegiht:bold;">
							<h3><?php echo $this->item->productname ?></h3></td><td width="15px">
							&nbsp;
						</td>
					</tr>
					<tr 
						<td width="15px" >
							&nbsp;
						</td>
						<td height="22" width="50%" style="border-bottom: 1px solid rgb(153, 153, 153);color:red;">
							Giá
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);color:red;">
							<h3><?php echo $this->item->price.' VND' ?></h3></td><td width="15px">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="50%" style="border-bottom: 1px solid rgb(153, 153, 153);">
							Loại xe
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<?php echo $this->item->catname ?></td><td width="15px">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td width="15px">
							&nbsp;
						</td>
						<td height="22" width="50%" style="border-bottom: 1px solid rgb(153, 153, 153);">
							Model
						</td>
						<td width="*" style="border-bottom: 1px solid rgb(153, 153, 153);">
							<?php echo $this->item->modename ?></td><td width="15px">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td colspan="3">
							<?php echo $this->item->description ?>
						</td>
					</tr>
				</tbody>
			</table>

			</div>
			<br/>
			<br/>
	<?php } 
		if($op=='bang-gia'){
			?>
			<div id="pnlThongSo">
				<?php echo $this->banggia ?>
			</div>
			<br/>
			<br/>
	<?php }
	if($op=='gallery'){
			?>
				<div id="container">
				<!-- Start Advanced Gallery Html Containers -->
				<div id="gallery" class="content">
					<div id="controls" class="controls"></div>
					<div class="slideshow-container">
						<div id="loading" class="loader"></div>
						<div id="slideshow" class="slideshow"></div>
						<div id="caption" class="caption-container"></div>
					</div>
					<div id="captionToggle">
						<a href="#toggleCaption" class="off" title="Show Caption">Show Caption</a>
					</div>
				</div>
				<div id="thumbs" class="navigation">
					<ul class="thumbs noscript">
					<?php foreach((array)$this->images as $image){ ?>
						<li>
							<a class="thumb" href="admin/images/products/<?php echo $image->image_name ?>" title="Title #4">
								<img src="admin/images/products/<?php echo $image->thumnail ?>" alt="Title #4" />
							</a>
							<div class="caption">
								<div class="download">
									<a href="admin/images/products/<?php echo $image->image_name ?>">Download Original</a>
								</div>
								<div class="image-title">Title #4</div>
								<div class="image-desc">Description</div>
							</div>
						</li>
					<?php } ?>
						
						
					</ul>
				</div>
				<!-- End Advanced Gallery Html Containers -->

				<div style="clear: both;"></div>
			</div>
			<script type="text/javascript">
			jQuery(document).ready(function($) {
				// We only want these styles applied when javascript is enabled
				jQuery('div.navigation').css({'width' : '695px', 'float' : 'left'});
				jQuery('div.content').css('display', 'block');

				// Initially set opacity on thumbs and add
				// additional styling for hover effect on thumbs
				var onMouseOutOpacity = 0.67;
				jQuery('#thumbs ul.thumbs li').opacityrollover({
					mouseOutOpacity:   onMouseOutOpacity,
					mouseOverOpacity:  1.0,
					fadeSpeed:         'fast',
					exemptionSelector: '.selected'
				});

				// Enable toggling of the caption
				var captionOpacity = 0.0;
				jQuery('#captionToggle a').click(function(e) {
					var link = $(this);
					
					var isOff = link.hasClass('off');
					var removeClass = isOff ? 'off' : 'on';
					var addClass = isOff ? 'on' : 'off';
					var linkText = isOff ? 'Hide Caption' : 'Show Caption';
					captionOpacity = isOff ? 0.7 : 0.0;

					link.removeClass(removeClass).addClass(addClass).text(linkText).attr('title', linkText);
					jQuery('#caption span.image-caption').fadeTo(1000, captionOpacity);
					
					e.preventDefault();
				});
				
				// Initialize Advanced Galleriffic Gallery
				var gallery = jQuery('#thumbs').galleriffic({
					delay:                     2500,
					numThumbs:                 15,
					preloadAhead:              10,
					enableTopPager:            true,
					enableBottomPager:         true,
					maxPagesToShow:            7,
					imageContainerSel:         '#slideshow',
					controlsContainerSel:      '#controls',
					captionContainerSel:       '#caption',
					loadingContainerSel:       '#loading',
					renderSSControls:          true,
					renderNavControls:         true,
					playLinkText:              'Play Slideshow',
					pauseLinkText:             'Pause Slideshow',
					prevLinkText:              '&lsaquo; Previous Photo',
					nextLinkText:              'Next Photo &rsaquo;',
					nextPageLinkText:          'Next &rsaquo;',
					prevPageLinkText:          '&lsaquo; Prev',
					enableHistory:             true,
					autoStart:                 false,
					syncTransitions:           true,
					defaultTransitionDuration: 900,
					onSlideChange:             function(prevIndex, nextIndex) {
						// 'this' refers to the gallery, which is an extension of $('#thumbs')
						this.find('ul.thumbs').children()
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
					},
					onTransitionOut:           function(slide, caption, isSync, callback) {
						slide.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0, callback);
						caption.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0);
					},
					onTransitionIn:            function(slide, caption, isSync) {
						var duration = this.getDefaultTransitionDuration(isSync);
						slide.fadeTo(duration, 1.0);
						
						// Position the caption at the bottom of the image and set its opacity
						var slideImage = slide.find('img');
						caption.width(slideImage.width())
							.css({
								'bottom' : Math.floor((slide.height() - slideImage.outerHeight()) / 2),
								'left' : Math.floor((slide.width() - slideImage.width()) / 2) + slideImage.outerWidth() - slideImage.width()
							})
							.fadeTo(duration, captionOpacity);
					},
					onPageTransitionOut:       function(callback) {
						this.fadeTo('fast', 0.0, callback);
					},
					onPageTransitionIn:        function() {
						this.fadeTo('fast', 1.0);
					},
					onImageAdded:              function(imageData, $li) {
						$li.opacityrollover({
							mouseOutOpacity:   onMouseOutOpacity,
							mouseOverOpacity:  1.0,
							fadeSpeed:         'fast',
							exemptionSelector: '.selected'
						});
					}
				});

				/**** Functions to support integration of galleriffic with the jquery.history plugin ****/

				// PageLoad function
				// This function is called when:
				// 1. after calling $.historyInit();
				// 2. after calling $.historyLoad();
				// 3. after pushing "Go Back" button of a browser
				function pageload(hash) {
					// alert("pageload: " + hash);
					// hash doesn't contain the first # character.
					if(hash) {
						$.galleriffic.gotoImage(hash);
					} else {
						gallery.gotoIndex(0);
					}
				}

				// Initialize history plugin.
				// The callback is called at once by present location.hash. 
				$.historyInit(pageload, "advanced.html");

				// set onlick event for buttons using the jQuery 1.3 live method
				$("a[rel='history']").live('click', function() {
					if (e.button != 0) return true;

					var hash = this.href;
					hash = hash.replace(/^.*#/, '');

					// moves to a new page. 
					// pageload is called at once. 
					// hash don't contain "#", "?"
					$.historyLoad(hash);

					return false;
				});

				
			});
		</script>
		<br/>
		<br/>
	<?php } ?>

</div>
         </div>